const myimage = document.querySelector("img");
myimage.onclick = () => {
    const mySrc = myimage.getAttribute("src");
    if (mySrc == "images/sanda.jpg") {
        myimage.setAttribute("src", "images/sanda.png");
    }
    else {
        myimage.setAttribute("src", "images/sanda.jpg");
    }
};


let myButton = document.querySelector("button");
let myHeading = document.querySelector("h1");

function setUserName() {
    const MyName = prompt("Please enter your name.");
    localStorage.setItem("name", MyName);
    myHeading.textContent = `Shanda is cool, ${myName}`;
}


if (!localStorage.getItem("name")) {
    setUserName();
}else {
    const storedname = localStorage.getItem("name");
    myHeading.textContent = `Shanda is cool, ${storedName}`;
}

myButton.onclick = function () {
    setUserName();
};
